You may have got your program to work perfectly first time. In that case good luck, and consider yourself graduated. However, my first version of the program didn't work that well. If you run project Exercise 8.3 and compare it with yours. I haven't quite finished it, in that there are a few messages which need adding, but there is enough there to see that we have some problems to sort out.

The most trivial problem is that some of the messages don't fit on the screen.

The most serious problems have to do with players who hold the button down. If the player holds the button down after they have seen the LED light the program whizzes past the score display. We need to wait until the button goes up before we start, and also after we have displayed the score. There is also the problem of those who press the button before the LED comes on.

We need to add some code which will wait for the button to go up at the correct points. You can implement this by adding a function called "upwait" which waits for a key to go up. This makes our program look more like this:

  1. Display the start message

  2. Wait for the button to go down

  3. Wait for the button to go up

  4. Wait for a while

  5. If the button is down now we have a foul - display this and go to step 1

  6. Light the led and start the timer

  7. Wait for the button to go down

  8. Display the score

  9. Wait for the button to go up

  10. Wait for the button to go down

  11. Wait for the button to go up again

  12. Go back to step 1

This shows how our "evolutionary" approach has led to a need to change our design. This is something you should try to avoid by making sure that your specification covers all the possibilities at the start, including the chance that people might try to cheat!

You should now try to improve your (or my) program so that it works more like the sequence given above.